/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __LED_H__
#define __LED_H__

/* Includes ------------------------------------------------------------------*/
#include "stm8s.h"

/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
#define LED_PORT    (GPIOC)
#define LED_PINS    (GPIO_PIN_3)
#define BEEP_PORT   (GPIOC)
#define BEEP_PINS   (GPIO_PIN_4)

#define SW_ON_PORT  (GPIOC)
#define SW_ON_PINS  (GPIO_PIN_5)
#define SW_OFF_PORT (GPIOC)
#define SW_OFF_PINS (GPIO_PIN_6)
#define SW_ON_IN    (SW_ON_PORT->IDR & SW_ON_PINS)
#define SW_OFF_IN   (SW_OFF_PORT->IDR & SW_OFF_PINS)

#define ON_STATUS   0x80
#define OFF_STATUS  0x40

typedef enum _eBeepType{
    BEEP_DO_NOTHING,
    BEEP_IDLE,
    MOUSE_ERROR,
    UART_ERROR
}eBeepType;

/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */

void Led_Init(void);
void Led_SetLed(bool iOn);
void Led_InvLed(void);
void Led_SetBeep(eBeepType iMode);
u8   GetSWStatus(void);
void Led_RunOne(void);

#endif /* __LED_H__ */

